 

/**
 * SalesLineItem class
 * @author Stefan
 */
public class SalesLineItem
{
    //Attributes

    private Product product;
    private int quantity;

    public SalesLineItem(Product newProduct, int quantity)
    {
        this.product = newProduct;
        this.quantity = quantity;
    }

    public Product getProduct()
    {
        return product;
    }

    public double subTotalPrice()
    {
        return product.getPrice() * getQuantity();
    }

    public void setQuantity(int quantity)
    {
        this.quantity = quantity;
    }

    public int getQuantity()
    {
        return quantity;
    }

    public void addQuantity(int quantity)
    {
        this.quantity += quantity;
    }
}
